print("Start: " + str(start)) |
while (index != -1): |
index = arr[index][1] |
print("*****LIST*****") |
def printOrder(linklist): |
print("*****FREES*****") |
index = nextfree |
index = start |
print("NextFree: " + str(nextfree)) |
print(str(index) + ": " + str(arr[index])) |
index = arr[index][1] |
print(str(index) + ": " + str(arr[index])) |
while (index != -1): |
    print("Start: " + str(start)) |
    while (index != -1): |
        index = arr[index][1] |
    print("*****LIST*****") |
def printOrder(linklist): |
    print("*****FREES*****") |
    index = nextfree |
    index = start |
    print("NextFree: " + str(nextfree)) |
        print(str(index) + ": " + str(arr[index])) |
        index = arr[index][1] |
        print(str(index) + ": " + str(arr[index])) |
    while (index != -1): |
1 | def printOrder(linklist): |
2 |     print("*****LIST*****") |
3 |     index = start |
4 |     while (index != -1): |
5 |         print(str(index) + ": " + str(arr[index])) |
6 |         index = arr[index][1] |
7 |          |
8 |     print("*****FREES*****") |
9 |     index = nextfree |
10 |     while (index != -1): |
11 |         print(str(index) + ": " + str(arr[index])) |
12 |         index = arr[index][1] |
13 |     print("Start: " + str(start)) |
14 |     print("NextFree: " + str(nextfree)) |
previous_index = -1 |
if previous_index == -1: |
arr[index][1] = nextfree |
printOrder(linkedlist) |
nextfree = index |
index = arr[index][1] |
previous_index = index |
if arr[index][0] == string: |
def removeItem(linklist, string): |
removeItem(linkedlist, "robin") |
arr[previous_index][1] = arr[index][1] |
while (index != -1): |
else: |
break |
start = arr[index][1] |
printOrder(linkedlist) |
index = start |
    previous_index = -1 |
    if previous_index == -1: |
    arr[index][1] = nextfree |
printOrder(linkedlist) |
    nextfree = index |
        index = arr[index][1] |
        previous_index = index |
        if arr[index][0] == string: |
def removeItem(linklist, string): |
removeItem(linkedlist, "robin") |
        arr[previous_index][1] = arr[index][1] |
    while (index != -1): |
    else: |
            break |
        start = arr[index][1] |
printOrder(linkedlist) |
    index = start |
1 | def removeItem(linklist, string): |
2 |     index = start |
3 |     previous_index = -1 |
4 |     while (index != -1): |
5 |         if arr[index][0] == string: |
6 |             break |
7 |         previous_index = index |
8 |         index = arr[index][1] |
9 |     if previous_index == -1: |
10 |         start = arr[index][1] |
11 |     else: |
12 |         arr[previous_index][1] = arr[index][1] |
13 |     arr[index][1] = nextfree |
14 |     nextfree = index |
15 | |
16 | printOrder(linkedlist) |
17 | removeItem(linkedlist, "robin") |
18 | printOrder(linkedlist) |
index = start |
break |
index = arr[index][1] |
if arr[index][0] > string: |
arr[lastindex][1] = newLocation |
arr[newLocation][1] = index |
def addItem(linklist,string): |
return |
if lastindex == -1: |
start = newLocation |
nextfree = arr[newLocation][1] |
while (index != -1): |
lastindex = index |
newLocation = nextfree |
arr[newLocation][0] = string |
lastindex = -1 |
    index = start |
            break |
        index = arr[index][1] |
        if arr[index][0] > string: |
    arr[lastindex][1] = newLocation |
    arr[newLocation][1] = index |
def addItem(linklist,string): |
        return |
    if lastindex == -1: |
        start = newLocation |
    nextfree = arr[newLocation][1] |
    while (index != -1): |
        lastindex = index |
    newLocation = nextfree |
    arr[newLocation][0] = string |
    lastindex = -1 |
1 | def addItem(linklist,string): |
2 |     newLocation = nextfree |
3 |     arr[newLocation][0] = string |
4 |     nextfree = arr[newLocation][1] |
5 |     index = start |
6 |     lastindex = -1 |
7 |     while (index != -1): |
8 |         if arr[index][0] > string: |
9 |             break |
10 |         lastindex = index |
11 |         index = arr[index][1] |
12 |     arr[newLocation][1] = index |
13 |     if lastindex == -1: |
14 |         start = newLocation |
15 |         return |
16 |     arr[lastindex][1] = newLocation |
return llist |
newlinkedlist = createLinkedList(10) |
llist["linklist"].append([None,-1]) |
def createLinkedList(size): |
for x in range(size-1): |
llist = {"linklist":[],"start": -1, "nextfree": 0} |
llist["linklist"].append([None,x+1]) |
    return llist |
newlinkedlist = createLinkedList(10) |
    llist["linklist"].append([None,-1]) |
def createLinkedList(size): |
    for x in range(size-1): |
    llist = {"linklist":[],"start": -1, "nextfree": 0} |
        llist["linklist"].append([None,x+1]) |
1 | def createLinkedList(size): |
2 |     llist = {"linklist":[],"start": -1, "nextfree": 0} |
3 |     for x in range(size-1): |
4 |         llist["linklist"].append([None,x+1]) |
5 |     llist["linklist"].append([None,-1]) |
6 |     return llist |
7 | |
8 | newlinkedlist = createLinkedList(10) |